<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台管理系统</title>
	<link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" href="/css/font-awesome.min.6.4.css">
    <link rel="stylesheet" href="/css/main.css">

</head>
<body>
    <!-- 统计卡片 -->
    <div class="stats-container">
        <div class="stat-card">
            <div class="stat-icon revenue">
                <i class="fas fa-calendar-day"></i>
            </div>
            <div class="stat-info">
                <h3>[[${index.issueTodayTotal}]]</h3>
                <p>今日需求</p>
            </div>
        </div>
        <div class="stat-card">
            <div class="stat-icon orders">
                <i class="fas fa-tasks"></i>
            </div>
            <div class="stat-info">
                <h3>[[${index.issueTotal}]]</h3>
                <p>总需求量</p>
            </div>
        </div>
		<div class="stat-card">
		    <div class="stat-icon activity">
				<i class="fa fa-clock "></i>
		    </div>
		    <div class="stat-info">
		        <h3>[[${index.pendingTotal}]]</h3>
		        <p>待处理需求</p>
		    </div>
		</div>
		<div class="stat-card">
		    <div class="stat-icon activity">
				<i class="fa fa-user-plus"></i>
		    </div>
		    <div class="stat-info">
		        <h3>[[${index.unassignedTotal}]]</h3>
		        <p>待分配需求</p>
		    </div>
		</div>
        <div class="stat-card">
            <div class="stat-icon users">
                <i class="fas fa-users"></i>
            </div>
            <div class="stat-info">
                <h3>[[${index.projectTotal}]]</h3>
                <p>客户数量</p>
            </div>
        </div>
    </div>
    
    <!-- 图表区域 -->
    <div class="charts-container">
        <th:block th:if="${(user.remarkJson != null and user.remarkJson.getInteger('issueStats') != null and user.remarkJson.getInteger('issueStats') == 1) or user.remarkJson == null}">
            <div class="chart-card">
                <div class="chart-header">
                    <h3>需求统计</h3>
                    <div class="chart-actions" style="display:none;">
                        <button>本月</button>
                        <button>季度</button>
                        <button>年度</button>
                    </div>
                </div>
                <div class="chart-container">
                    <canvas id="revenueChart"></canvas>
                </div>
            </div>
        </th:block>
        <th:block th:if="${(user.remarkJson != null and user.remarkJson.getInteger('customerIssueStats') != null and user.remarkJson.getInteger('customerIssueStats') == 1) or user.remarkJson == null}">
            <div class="chart-card">
                <div class="chart-header">
                    <h3>客户需求TOP10</h3>
                    <div class="chart-actions" style="display:none;">
                        <button>来源</button>
                        <button>地区</button>
                    </div>
                </div>
                <div class="chart-container">
                    <canvas id="userChart"></canvas>
                </div>
            </div>
        </th:block>
    </div>
    <th:block th:if="${user.remarkJson != null and user.remarkJson.getInteger('calendar') != null and user.remarkJson.getInteger('calendar') == 1}">
        <div class="block-calendar">
            <div class="content-header">
                <h3>日历</h3>
                <div class="calendar-filter" th:if="${user.isAdmin() == true}">
                    <select class="form-control" id="assigneeFilter">
                        <option value="">全部指派人</option>
                        <option th:each="user : ${userList}" th:value="${user.id}" th:text="${user.name}">指派人</option>
                    </select>
                </div>
            </div>
            <ul class="cal">
                <li scope="col" title="周" class="calhead week-number"></li>
                <li scope="col" class="calhead">星期一</li>
                <li scope="col" class="calhead">星期二</li>
                <li scope="col" class="calhead">星期三</li>
                <li scope="col" class="calhead">星期四</li>
                <li scope="col" class="calhead">星期五</li>
                <li scope="col" class="calhead">星期六</li>
                <li scope="col" class="calhead">星期天</li>
                <li class="week-number">[[${calendar.weekOfYear}]]</li>
                <th:block th:each="date, iterStat : ${calendar.weekDates}">
                    <li th:classappend="${iterStat.index >= 5 ? 'nwday' : ''} + ' ' + ${#temporals.format(#temporals.createToday(), 'd') == date ? 'today' : ''}" 
                        class="this-month calbody">
                        <p class="day-num" th:text="${date}">日期</p>
                        <th:block th:each="issue : ${calendar.issuesByDate.get(date)}">
                            <div class="issue overdue behind-schedule tooltip hascontextmenu ending" th:classappend="'tracker-' + ${issue.trackerId} + ' status-' + ${issue.statusId} + ' priority-' + ${issue.priorityId} + ' priority-high3'">
                                [[${issue.projectName}]] -
                                <a class="issue overdue behind-schedule" href="JavaScript:void(0);" th:onclick="'$.modal.openTab(\'#' + ${issue.id} + '\',\'/project/issue/' + ${issue.id} + '\');'">[[${issue.trackerName}]] #[[${issue.id}]]</a>: [[${issue.subject}]]
                                <span class="tip">
                                    <a class="issue overdue behind-schedule" href="JavaScript:void(0);" th:onclick="'$.modal.openTab(\'#' + ${issue.id} + '\',\'/project/issue/' + ${issue.id} + '\');'">[[${issue.trackerName}]] #[[${issue.id}]]</a>: [[${issue.subject}]]
                                    <br><br>
                                    <strong>项目</strong>: [[${issue.projectName}]]<br>
                                    <strong>状态</strong>: [[${issue.statusName}]]<br>
                                    <strong>开始日期</strong>: [[${issue.startDate}]]<br>
                                    <strong>计划完成日期</strong>: [[${issue.dueDate}]]<br>
                                    <strong>指派给</strong>: [[${issue.assignedToName}]]<br>
                                    <strong>优先级</strong>: [[${issue.priorityName}]]
                                </span>
                                <input type="checkbox" name="ids[]" value="3997" style="display:none;">
                            </div>
                        </th:block>
                    </li>
                </th:block>
            </ul>
        </div>
    </th:block>

	<!-- 消息和任务区域 - 左右两个独立模块 -->
    <div class="content-grid">
        <!-- 左侧：最新消息 -->
        <th:block th:if="${(user.remarkJson != null and (user.remarkJson.getInteger('latestMessages') == null or user.remarkJson.getInteger('latestMessages') == 1)) or user.remarkJson == null}">
            <div class="content-card" >
                <div class="content-header">
                    <h3>最新消息</h3>
                    <button class="btn" onclick="$.modal.openTab('我的消息','/system/message/receive');">查看全部</button>
                </div>
                <div class="content-list">
                    <!-- 动态显示用户消息列表 -->
                    <div th:if="${userMessageList != null and !userMessageList.isEmpty()}">
                        <div th:each="message : ${userMessageList}" class="list-item" th:classappend="${message.readStatus == 0} ? 'item-unread' : ''">
                            <div class="unread-indicator" th:if="${message.readStatus == 0}"></div>
                            <div class="item-avatar" th:style="'background: ' + ${message.displayColor}">
                                <span th:text="${message.createTime != null} ? ${#temporals.format(message.createTime, 'HH:mm')} : '刚刚'">0:00</span>
                            </div>
                            <div class="item-content" th:onclick="'viewMessage(' + ${message.messageId} + ')'">
                                <div class="item-header">
                                    <div class="item-title" th:text="${message.title != null} ? ${message.title} : '系统消息'">消息标题</div>
                                    <div class="item-time" th:text="${message.createTime != null} ? ${#temporals.format(message.createTime, 'yyyy/MM/dd')} : '刚刚'">时间</div>
                                </div>
                                <div class="task-desc">
                                    优先级：
                                    <span th:with="type=${@dict.getType('sys_message_priority')}">
                                        <span th:each="dict : ${type}" th:if="${dict.dictValue.toString() == message.priority.toString()}" class="task-priority" th:classappend="'badge-' + ${dict.listClass}" style="margin-left: 0;">
                                            [[${dict.dictLabel}]]
                                        </span>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 如果没有消息，显示没有数据 -->
                    <div th:if="${userMessageList == null or userMessageList.isEmpty()}" class="no-data">
                        <div class="no-data-icon">
                            <i class="fas fa-inbox"></i>
                        </div>
                        <div class="no-data-text">暂无消息</div>
                    </div>
                </div>
            </div>
        </th:block>
        
        <!-- 右侧：我的任务 -->
        <th:block th:if="${(user.remarkJson != null and (user.remarkJson.getInteger('myTasks') == null or user.remarkJson.getInteger('myTasks') == 1)) or user.remarkJson == null}">
            <div class="content-card" >
                <div class="content-header">
                    <h3>我的任务</h3>
                    <div class="">
                        <button class="btn btn-outline" onclick="$.modal.openTab('新建需求','/project/issue/new');">添加任务</button>&nbsp;
                        <button class="btn" onclick="$.modal.openTab('需求管理','/project/issue/index');">查看全部</button>
                    </div>
                </div>
                <div class="content-list">
                    <!-- 动态显示用户任务列表 -->
                    <div th:if="${userIssueList != null and !userIssueList.isEmpty()}">
                        <div th:each="issue : ${userIssueList}" class="task-item">
                            <input type="checkbox" class="task-checkbox" th:checked="${issue.statusId == 6}" disabled>
                            <div class="task-content" th:onclick="'$.modal.openTab(\'#' + ${issue.id} + '\',\'/project/issue/' + ${issue.id} + '\');'">
                                <div class="task-header">
                                    <div class="task-title" th:style="${issue.statusId == 6} ? 'text-decoration: line-through; color: rgb(108, 117, 125);' : ''">
                                        <span th:text="${issue.trackerName} + '# ' + ${issue.subject}">任务主题</span>
                                        <span class="task-priority" th:classappend="'priority-' + ${priority.listClass}" th:switch="${issue.priorityId}" th:each="priority : ${issuePrioritieList}" th:if="${priority.id == issue.priorityId}">
                                            <span class="badge" th:classappend="'priority-' + ${priority.listClass}">[[${priority.name}]]</span>
                                        </span>
                                    </div>
                                    <div class="task-time" th:text="${#temporals.format(issue.updateTime, 'MM-dd HH:mm')}">17:00</div>
                                </div>
                                <div class="task-desc" th:style="${issue.statusId == 6} ? 'text-decoration: line-through;' : ''">
                                    <span th:if="${issue.projectName != null}" th:text="'项目：' + ${issue.projectName}">项目名称</span>&emsp;
                                    <span th:if="${issue.dueDate != null}" th:text="'截止：' + ${#temporals.format(issue.dueDate, 'yyyy-MM-dd')}">截止日期</span>
                                    <span th:if="${issue.statusName != null}" th:classappend="${issue.statusId == 1} ? 'status-new' : (${issue.statusId == 2} ? 'status-in-progress' : (${issue.statusId == 3} ? 'status-pending-test' : (${issue.statusId == 4} ? 'status-resolved' : (${issue.statusId == 5} ? 'status-feedback' : (${issue.statusId == 6} ? 'status-closed' : 'status-reopened')))))" th:text="'状态：' + ${issue.statusName}">状态</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 如果没有任务，显示没有数据 -->
                    <div th:if="${userIssueList == null or userIssueList.isEmpty()}" class="no-data">
                        <div class="no-data-icon">
                            <i class="fas fa-tasks"></i>
                        </div>
                        <div class="no-data-text">暂无任务</div>
                    </div>
                </div>
            </div>
        </th:block>
    </div>
    
    <!-- 新增的大型统计图表 -->
    <th:block th:if="${user.remarkJson != null and user.remarkJson.getInteger('projectIssueStats') != null and user.remarkJson.getInteger('projectIssueStats') == 1}">
        <div class="large-chart-container">
            <div class="large-chart-header">
                <h3>项目需求综合分析</h3>
                <div class="large-chart-actions" style="display:none;">
                    <button class="active">收入</button>
                    <button>用户</button>
                    <button>订单</button>
                    <button>转化率</button>
                </div>
            </div>
            <div class="large-chart">
                <canvas id="comprehensiveChart"></canvas>
            </div>
        </div>
    </th:block>
    
    <!-- 统计表格 -->
    <th:block th:if="${user.remarkJson != null and user.remarkJson.getInteger('projectStats') != null and user.remarkJson.getInteger('projectStats') == 1}">
        <div class="stats-table-container">
            <div class="stats-table-header">
                <h3>项目统计</h3>
                <button class="btn" onclick="queryProjectForIssueDetail();">刷新数据</button>
            </div>
            <input type="hidden" name="issueStatus" th:each="issueStatus : ${issueStatusList}" th:value="${issueStatus.id}">
            <table class="stats-table" id="bootstrap-table">
                <thead>
                    <tr>
                        <th>项目名称</th>
                        <th>客户名称</th>
                        <th>状态</th>
                        <th>总需求数量</th>
                        <th th:each="issueStatus : ${issueStatusList}">[[${issueStatus.name}]]</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td th:colspan="${#lists.size(issueStatusList) + 4}" class="text-center">数据加载中...</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </th:block>
	<input type="hidden" id="projectNameList" th:value="${project.projectNameList}">
	<input type="hidden" id="identifierList" th:value="${project.identifierList}">
	<input type="hidden" id="issueTotalList" th:value="${project.issueTotalList}">

	<input type="hidden" id="monthList" th:value="${issue.monthList}">
	<input type="hidden" id="issueCountList" th:value="${issue.totalList}">
	<input type="hidden" id="userRemark" th:value="${user.remarkJson}">
    
	<th:block th:include="include :: footer" />
	<script th:src="@{/js/chart.min.js}"></script>
	<script th:src="@{/js/calendar_tooltip.js}"></script>
    <script>
        var userRemark = $("#userRemark").val();
        var remarkJson = userRemark ? JSON.parse($("#userRemark").val()) : '';
		var monthList = JSON.parse(document.getElementById('monthList').value);
		var issueCountList = JSON.parse(document.getElementById('issueCountList').value);
        // 初始化图表
        document.addEventListener('DOMContentLoaded', function() {

            if((remarkJson !='' && remarkJson.issueStats == 1) || remarkJson == ''){
                // 收入统计图表
                const revenueCtx = document.getElementById('revenueChart').getContext('2d');
                const revenueChart = new Chart(revenueCtx, {
                    type: 'line',
                    data: {
                        labels: monthList,
                        datasets: [{
                            label: '',
                            data: issueCountList,
                            borderColor: '#4361ee',
                            backgroundColor: 'rgba(67, 97, 238, 0.1)',
                            borderWidth: 2,
                            fill: true,
                            tension: 0.4
                        }]
                    },
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        plugins: {
                            legend: {
                                display: false
                            }
                        },
                        scales: {
                            y: {
                                beginAtZero: true,
                                grid: {
                                    color: 'rgba(0, 0, 0, 0.05)'
                                }
                            },
                            x: {
                                grid: {
                                    display: false
                                }
                            }
                        }
                    }
                });
            }
			// 从隐藏字段获取JSON字符串并解析
			var projectNameList = JSON.parse(document.getElementById('projectNameList').value);
			var identifierList = JSON.parse(document.getElementById('identifierList').value);
			var issueTotalList = JSON.parse(document.getElementById('issueTotalList').value);

			// 随机颜色选择函数
			function getRandomColor() {
				var colors = ['#4361ee', '#4cc9f0', '#f72585', '#6c757d'];
				return colors[Math.floor(Math.random() * colors.length)];
			}

			// 为每个数据项生成颜色数组
			function generateColors(count) {
				var colors = [];
				for (var i = 0; i < count; i++) {
					colors.push(getRandomColor());
				}
				return colors;
			}

            
            if((remarkJson !='' && remarkJson.customerIssueStats == 1) || remarkJson == ''){
                // 用户分布图表
                const userCtx = document.getElementById('userChart').getContext('2d');
                const userChart = new Chart(userCtx, {
                    type: 'doughnut',
                    data: {
                        labels: projectNameList,
                        datasets: [{
                            data: issueTotalList,
                            backgroundColor: identifierList,
                            borderWidth: 0
                        }]
                    },
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        plugins: {
                            legend: {
                                position: 'bottom'
                            }
                        },
                        cutout: '70%'
                    }
                });
            }
            

            if(remarkJson !='' && remarkJson.projectIssueStats == 1){
                // 新增的大型综合图表 - 从API获取项目需求分布数据
                const comprehensiveCtx = document.getElementById('comprehensiveChart').getContext('2d');
                let comprehensiveChart = null;
                
                // 从API获取项目需求分布数据并更新图表
                function loadComprehensiveChartData() {
                    $.ajax({
                        url: ctx + "statistics/projectIssueDistribution",
                        type: "get",
                        success: function(result) {
                            if (result.code === 0 && result.data) {
                                updateComprehensiveChart(result.data);
                            } else {
                                console.error('获取项目需求分布数据失败:', result.msg);
                                // 使用默认数据作为后备
                                updateComprehensiveChartWithDefaultData();
                            }
                        },
                        error: function(xhr, status, error) {
                            console.error('获取项目需求分布数据出错:', error);
                            // 使用默认数据作为后备
                            updateComprehensiveChartWithDefaultData();
                        }
                    });
                }
                
                // 使用API数据更新图表
                function updateComprehensiveChart(distributionData) {
                    // 只显示前12个项目（按月显示）
                    const projectNames = distributionData.map(item => item.project_name || '未知项目');
                    const issueCounts = distributionData.map(item => item.issue_count || 0);
                    
                    if (comprehensiveChart) {
                        comprehensiveChart.destroy();
                    }
                    
                    comprehensiveChart = new Chart(comprehensiveCtx, {
                        type: 'bar',
                        data: {
                            labels: projectNames,
                            datasets: [
                                {
                                    label: '需求数量',
                                    data: issueCounts,
                                    backgroundColor: 'rgba(67, 97, 238, 0.7)',
                                    borderColor: '#4361ee',
                                    borderWidth: 1
                                }
                            ]
                        },
                        options: {
                            responsive: true,
                            maintainAspectRatio: false,
                            plugins: {
                                legend: {
                                    position: 'top',
                                },
                                title: {
                                    display: true,
                                    text: '项目需求分布TOP12'
                                }
                            },
                            scales: {
                                y: {
                                    beginAtZero: true,
                                    grid: {
                                        color: 'rgba(0, 0, 0, 0.05)'
                                    },
                                    title: {
                                        display: true,
                                        text: '需求数量'
                                    }
                                },
                                x: {
                                    grid: {
                                        display: false
                                    },
                                    title: {
                                        display: true,
                                        text: '项目名称'
                                    }
                                }
                            }
                        }
                    });
                }
            
                // 使用默认数据作为后备
                function updateComprehensiveChartWithDefaultData() {
                    if (comprehensiveChart) {
                        comprehensiveChart.destroy();
                    }
                    
                    comprehensiveChart = new Chart(comprehensiveCtx, {
                        type: 'bar',
                        data: {
                            labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
                            datasets: [
                                {
                                    label: '收入 (万元)',
                                    data: [85, 92, 78, 95, 87, 102, 115, 98, 120, 128, 132, 120],
                                    backgroundColor: 'rgba(67, 97, 238, 0.7)',
                                    borderColor: '#4361ee',
                                    borderWidth: 1
                                },
                                {
                                    label: '用户增长',
                                    data: [120, 150, 180, 210, 240, 280, 320, 360, 400, 450, 142, 110],
                                    backgroundColor: 'rgba(76, 201, 240, 0.7)',
                                    borderColor: '#4cc9f0',
                                    borderWidth: 1
                                },
                                {
                                    label: '订单量',
                                    data: [800, 850, 920, 950, 1000, 1100, 1200, 1150, 1250, 1300, 152, 130],
                                    backgroundColor: 'rgba(247, 37, 133, 0.7)',
                                    borderColor: '#f72585',
                                    borderWidth: 1
                                }
                            ]
                        },
                        options: {
                            responsive: true,
                            maintainAspectRatio: false,
                            plugins: {
                                legend: {
                                    position: 'top',
                                },
                                title: {
                                    display: true,
                                    text: '年度业务综合分析'
                                }
                            },
                            scales: {
                                y: {
                                    beginAtZero: true,
                                    grid: {
                                        color: 'rgba(0, 0, 0, 0.05)'
                                    }
                                },
                                x: {
                                    grid: {
                                        display: false
                                    }
                                }
                            }
                        }
                    });
                }
                
                // 页面加载完成后获取数据
                loadComprehensiveChartData();
            }
            
            // 为按钮添加交互效果
            document.querySelectorAll('.btn, .chart-actions button, .large-chart-actions button').forEach(button => {
                button.addEventListener('click', function() {
                    this.style.transform = 'scale(0.95)';
                    setTimeout(() => {
                        this.style.transform = 'scale(1)';
                    }, 150);
                    
                    // 大型图表按钮激活状态
                    if (this.closest('.large-chart-actions')) {
                        document.querySelectorAll('.large-chart-actions button').forEach(btn => {
                            btn.classList.remove('active');
                        });
                        this.classList.add('active');
                    }
                });
            });
            
            // 任务复选框交互
            document.querySelectorAll('.task-checkbox').forEach(checkbox => {
                checkbox.addEventListener('change', function() {
                    const taskItem = this.closest('.task-item');
                    const taskTitle = taskItem.querySelector('.task-title');
                    const taskDesc = taskItem.querySelector('.task-desc');
                    
                    if (this.checked) {
                        taskTitle.style.textDecoration = 'line-through';
                        taskTitle.style.color = '#6c757d';
                        taskDesc.style.textDecoration = 'line-through';
                    } else {
                        taskTitle.style.textDecoration = 'none';
                        taskTitle.style.color = '';
                        taskDesc.style.textDecoration = 'none';
                    }
                });
            });
			
			// 消息点击标记为已读
			document.querySelectorAll('.list-item').forEach(item => {
			    item.addEventListener('click', function() {
			        this.classList.remove('item-unread');
			        const indicator = this.querySelector('.unread-indicator');
			        if (indicator) {
			            indicator.remove();
			        }
			        const title = this.querySelector('.item-title');
			        if (title) {
			            title.style.fontWeight = '600';
			            title.style.color = '';
			        }
			    });
			});
        });
		
		$(function(){
			queryProjectForIssueDetail();
		})
		//项目统计
        function queryProjectForIssueDetail(){
			var issueStatusArray = $("input[name='issueStatus']").map(function() {
                return $(this).val();
            }).get();
            
            if(remarkJson !='' && remarkJson.projectStats == 1){
            }else{
                return ;
            }
            
            // 显示加载提示
            var tbody = document.querySelector('#bootstrap-table tbody');
            tbody.innerHTML = `<tr><td th:colspan="[[${#lists.size(issueStatusList) + 4}]]" class="text-center">数据加载中...</td></tr>`;
            
            $.ajax({
                url: ctx + "statistics/queryProjectForIssueDetail",
                type: "POST",
                success: function(data) {
                    if (data.code === 0) {
                        tbody.innerHTML = '';
                        if (data.data && data.data.length > 0) {
                            data.data.forEach(function(item) {
                                var row = document.createElement('tr');
                                row.innerHTML = `
                                    <td>${item.projectName || '-'}</td>
                                    <td>${item.customerName || '-'}</td>
                                    <td>${item.state || '-'}</td>
                                    <td>${item.issueTotal || '0'}</td>
                                    ${issueStatusArray.map(status => `<td>${item['statusTotal' + status]}</td>`).join('')}
                                `;
                                tbody.appendChild(row);
                            });
                        } else {
                            tbody.innerHTML = `<tr><td th:colspan="[[${#lists.size(issueStatusList) + 4}]]" class="text-center">暂无数据</td></tr>`;
                        }
                    } else {
                        $.modal.alertWarning(data.msg);
                        tbody.innerHTML = `<tr><td th:colspan="[[${#lists.size(issueStatusList) + 4}]]" class="text-center">加载失败</td></tr>`;
                    }
                },
                error: function() {
                    $.modal.alertError("请求失败，请稍后重试！");
                    tbody.innerHTML = `<tr><td th:colspan="[[${#lists.size(issueStatusList) + 4}]]" class="text-center">加载失败</td></tr>`;
                }
            });
        }

		
		// 查看通知详情
		function viewMessage(messageId) {
		    $.modal.openTab("通知详情", "/system/message/view/" + messageId);
		}
    </script>
</body>
</html>
